import {createRouter, createWebHashHistory} from 'vue-router'


const routes = [
    {
        name: "Home",
        path: "/",
        component: () => import('../views/Home'),
        children: [
            { path: '/', component: () => import('../views/Default')},
            //用户管理
            { path: '/user/admin', component: () => import('../views/User/Admin')},
            { path: '/user/company', component: () => import('../views/User/company')},
            { path: '/user/user', component: () => import('../views/User/user')},

            //会员流水
            { path: '/water/user', component: () => import('../views/Water/User')},

            //活动
            { path: '/activity/temp', component: () => import('../views/Activity/Template')}, //活动模板
            { path: '/activity/list', component: () => import('../views/Activity/Activity')}, //活动列表

            //签到活动 /activity/signin/list
            { path: '/activity/signin/sign', component: () => import('../views/Sign/Sign')}, //活动列表
            { path: '/activity/signin/list', component: () => import('../views/Sign/List')}, //活动列表


            //礼品
            { path: '/Gift/Gift', component: () => import('../views/Gift/Gift')}, //礼品列表
            { path: '/Gift/exchange', component: () => import('../views/Gift/exchange')}, //消费记录

            //系统
            { path: '/sys/system', component: () => import('../views/Sys/system')}, //系统配置
            { path: '/sys/link', component: () => import('../views/Sys/link')}, //系统配置

            { path: '/sys/chart/class', component: () => import('../views/Sys/chart/class')}, //图分类
            { path: '/sys/chart/list', component: () => import('../views/Sys/chart/list')}, //图列表

            { path: '/sys/news/class', component: () => import('../views/Sys/news/class')}, //新闻分类
            { path: '/sys/news/list', component: () => import('../views/Sys/news/list')}, //新闻分类

            { path: '/:pathMatch(.*)*', redirect: '/'}
        ]
    },
    {
        name: "Login",
        path: "/login",
        component: () => import('../views/Login'),
    },
    {path: '/:pathMatch(.*)*', redirect: '/'},
]


const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router